/**
 * @author zhaozeyang
 * @date 2018/11/2 10:33
 * @description
 */
public class 五十八 {

    public static void main(String[] args) {
      System.out.println(lengthOfLastWord(" "));
    }

    public static int lengthOfLastWord(String s) {
        if ("".equals(s.trim())) {
            return 0;
        }
        String[] ss=s.split(" ");
        return ss[ss.length-1].length();
    }
}
